(require 'gnus)
(require 'starttls)
(require 'smtpmail)
;(setq mail-sources '((file)))

(setq user-mail-address "buhtiyarov@effy.eu")
(setq user-full-name "Дмитрий Бухтияров") 

;(setq gnus-select-method '(nnrss "nnrss:drupal.org"))

(setq gnus-select-method '(nnimap "gmail"
                                  (nnimap-address "imap.gmail.com")
                                  (nnimap-server-port 993)
                                  (nnimap-authinfo-file "~/.authinfo")
                                  (nnimap-stream ssl)))

(setq gnus-summary-line-format "%U%R%z[%6d: %-23,23A] %S (%k)\n")

(setq smtpmail-local-domain nil)
(setq gnus-permanently-visible-groups "INBOX")
(executable-find starttls-program)

;;       (nnimap-address "imap.gmail.com")
;;       (nnimap-server-port 993)
;;       (nnimap-stream ssl)
;;       (nnimap-authenticator login))
;; (setq gnus-select-method '(nnimap "gmail"
;;   (nnimap-address "imap.gmail.com")
;;   (nnimap-server-port 993)
;;   (nnimap-stream ssl)
;;   ;(nnimap-authenticator login)
;;   ))
;; (add-to-list 'gnus-secondary-select-methods '(nnimap "gmail"
;;   (nnimap-address "imap.gmail.com")
;;   (nnimap-server-port 993)
;;   (nnimap-stream ssl)
;;   (nnimap-authenticator login)))

(setq message-send-mail-function 'smtpmail-send-it
      ;; send-mail-function ’smtpmail-send-it
      smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
      smtpmail-auth-credentials '(("smtp.gmail.com" 587 "buhtiyarov@effy.eu" nil))
      smtpmail-default-smtp-server "smtp.gmail.com"
      smtpmail-smtp-server "smtp.gmail.com"
      smtpmail-smtp-service 587
      smtpmail-local-domain "effy.eu")
